<template>
  <div>
    <el-container style="height: 720px; border: 1px solid #eee">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu>
          <router-link to="/admin/teacher" class="tdn">
            <el-menu-item index="1" style="padding-left: 30px">
              <i class="el-icon-s-custom"></i>
              <span slot="title">教师排课时间</span>
            </el-menu-item>
          </router-link>
          <router-link to="/admin/student" class="tdn">
            <el-menu-item index="2" style="padding-left: 30px">
              <i class="el-icon-menu"></i>
              <span slot="title">学生选课时间</span>
            </el-menu-item>
          </router-link>
        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: center; font-size: 16px; background-color: rgb(238, 241, 246); line-height: 60px">
          <span>最伟大的管理员您好！</span>
          <el-button style="float: right; margin-top: 10px" @click="logout">退出登录</el-button>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
    <hr />
  </div>
</template>

<script>
export default {
  name: 'Admin',
  methods: {
    logout() {
      localStorage.removeItem('token')
      this.$router.push('/login')
      this.$message('退出登录成功！')
    }
  }
}
</script>

<style lang="less" scoped>
.tdn {
  text-decoration: none;
}
</style>
